﻿@using MvcPaging
@model IPagedList<Classified.Domain.Entities.MessageInfo>
@{
    ViewBag.Title = "Message Info";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h1>
    List of <small>Message</small></h1>
<table class="table table-bordered table-striped">
    <thead>
        <th>
            Sender Full Name
        </th>
        <th>
            Sender Email Address
        </th>
        <th>
            Subject
        </th>
        <th>
            Sent Date
        </th>
        <th>
        </th>
    </thead>
    @foreach (var item in Model)
    {
        
        <tr id="@item.Id">
            <td>
                @Html.DisplayFor(modelItem => item.Sender_FullName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Sender_EmailAddress)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Subject)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.SentDate)
            </td>
            <td>
                @Html.ActionLink("Read Message", "ReadMessage", new { controller = "Home", id = item.Id })
            </td>
        </tr>
        if(!item.IsRead)
        {
            <script>
                $("#" + @item.Id).css("font-weight", "bold");
            </script>
        }
    }
</table>
@if (Model.TotalItemCount > 0)
{
    <div class="pagingContainer noprint">
        @Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount)
    </div>
}